<?php

namespace addons\shopro\controller;

use addons\shopro\exception\Exception;

class UserWalletLog extends Base
{

    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];


    public function index()
    {
        $params = $this->request->get();
        $wallet_type = $params['wallet_type'] ?? 'money';

        if (!in_array($wallet_type, ['money', 'score','mutual'])) {
            $this->error('参数错误');
        }
        $msg = [
            'money' => '钱包记录',
            'score' => '积分记录',
            'mutual' => '互助金消费明细'
        ];
        $this->success($msg[$wallet_type], \addons\shopro\model\UserWalletLog::getList($params));
    }

}
